#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	char arr[100][200];
	int i = 0;
	int x;
	while (1)
	{
		x = scanf("%[a-z|A-Z]", arr[i]);
		if (getchar() == '\n')
		{
			break;
		}
		if (x)
		{
			i++;
		}
	}
	for (int j = i; j >= 0; j--)
	{
		printf("%s ", arr[j]);
	}


	return 0;
}